﻿jQuery(window).load(function () {
    footer();

    //---buttons and links
    jQuery(".lists").click(function () {
        setPhase3();
    });
    //---end

    jQuery(".m-menu").click(function () {
        jQuery("#container").toggleClass("active");
        jQuery(".m-menu").toggleClass("active");
        jQuery(".mobile-menu").toggleClass("active");
        jQuery(".mobile-menu-bg").addClass("active");
        jQuery(".mobile-menu-bg").addClass("hidden-desktop");
        jQuery(".mobile-menu-bg").addClass("visible-phone");
    });

    jQuery(".mobile-menu").css("left", "-245px");
    jQuery(".mobile-menu-bg").css("left", "-245px");

    var isExpanded = false;
    jQuery(".m-menu").click(function () {
        if (!isExpanded) {
            jQuery(".mobile-menu").animate({ left: "0" }, { duration: 300, queue: false });
            jQuery(".mobile-menu-bg").animate({ left: "0" }, { duration: 300, queue: false });
            jQuery("#container").animate({ "margin-left": "245px" }, { duration: 300, queue: false });
            jQuery("#container").animate({ "margin-right": "-200px" }, { duration: 300, queue: false });
        }
        else {
            jQuery(".mobile-menu-bg").animate({ left: "-245" }, { duration: 300, queue: false });
            jQuery(".mobile-menu").animate({ left: "-245" }, { duration: 300, queue: false });
            jQuery("#container").animate({ "margin-left": "0" }, { duration: 300, queue: false });
            jQuery("#container").animate({ "margin-right": "0" }, { duration: 300, queue: false });
        }
        isExpanded = !isExpanded;
    });

});

function setPhase1() // search all
{
    jQuery("#divFirstSearch").css("display", "block");
    jQuery("#divSecondSearch").css("display", "none");
    jQuery("#divSearchDetails").css("display", "none");

    jQuery("#DefaultPricing").css("display", "none");
    jQuery("#SpecialRules").css("display", "none");
}

function CustomMessageSuccess(cusMsgSuccess) {
    var msg = "";
    msg = msg + "<div class=\"alert alert-success\">" + cusMsgSuccess + "</div>";

    jQuery("#Message").html(msg).fadeIn(1000).delay(2000).fadeOut(1000);
}

function CustomMessageError(cusMsgError) {
    var msg = "";
    msg = msg + "<div class=\"alert alert-error\">" + cusMsgError + "</div>";

    jQuery("#Message").html(msg).fadeIn(1000).delay(2000).fadeOut(1000);
}